home *** CD-ROM | disk | FTP | other *** search
- /* strerror.c From TC Bible page 283 Use __strerror to construct an error
- message consisting of your message concatenated with a system message
- corresponding to the last error that occured in a library routine */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <io.h>
- #include <string.h>
- main()
- {
- int handle=100;
- char *errmsg;
-
- /* Generate an error condition by attempting to duplicate a unused
- file handle 100 */
-
- if(dup(handle) == -1)
- {
- errmsg = _strerror("Error duplicating handle");
- printf(errmsg);
- }
-
- }